package cn.duxiaod.demo.proxy.jdkDynamicProxy;

import java.lang.reflect.Proxy;

public class JdkDynamicProxyFactory {
    public static Object getProxy(Object object){
        return Proxy.newProxyInstance(object.getClass().getClassLoader(),//目标类的类加载
                object.getClass().getInterfaces(),//代理需要实现的接口，可以多个
                new DebugInvocationHandle(object));// 代理对象对应的自定义InvocationHandle
    }
}
